<template>
  <div id="orderManager_details">
    <!-- <h3>这是订单管理的详情页面</h3> -->
    <el-link type="primary" class="back" @click="back">返回</el-link>
    <p>订单编号：{{ details.id }}</p>
    <p>下单时间：{{ details.orderTime }}</p>
    <p>订单状态：{{ details.status }}</p>
    <p>员工编号：{{ details.waiterId }}</p>
    <p>顾客：{{ details.customer.realname }}</p>
    <p>顾客手机号：{{ details.customer.telephone }}</p>
  </div>
</template>
<script>
export default {
  data() {
    return {
      details: {}
    }
  },
  // computed: {
  //   // 计算下单时间
  //   orderTime() {
  //     this.details.orderTime = new Date(this.details.orderTime).toLocaleDateString()
  //     return this.details.orderTime
  //   }
  // },
  created() {
    this.$axios.get('/order/findById', {
      params: { id: this.$route.query.id }
    }).then(res => {
      console.log(res)
      this.details = res.data.data
      this.details.orderTime = new Date(this.details.orderTime).toLocaleDateString()
      return this.details
    })
  },
  methods: {
    // 给返回按钮绑定事件
    back() {
      this.$router.back()
    }
  }
}
</script>
<style lang="scss" scoped>
     #orderManager_details{
        padding: 20px;
        .back{
            font-size: 14px;
        }
    }
</style>
